// !点击按钮开启定时器
import React, { useState } from 'react'

export default function App() {
  const [count, setCount] = useState(10)
  const handleClick = () => {
    setInterval(() => {
      setCount((count) => count - 1)
    }, 1000)
  }
  return (
    <div>
      <h3>{count}</h3>
      <button onClick={handleClick}>开启定时器</button>
    </div>
  )
}
